package clone方法的讲解;

import lombok.ToString;

import java.io.Serializable;

/**
 * 要实现Serializable序列化接口
 */
@ToString
public class Person implements Serializable {

    private String name;

    private int age;


    /**
     * 聚合Children类
     */
    private Children children;


    public Person(String name, int age,Children children) {
        this.name = name;
        this.age = age;
        this.children=children;
    }

    public Children getChildren() {
        return children;
    }

    public void setChildren(Children children) {
        this.children = children;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
